package com.wenjiang.controller;

import com.wenjiang.common.annotation.OperatorLog;
import com.wenjiang.common.dto.ChangeMenuRoleParam;
import com.wenjiang.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    MenuService menuService;


    //获取全部菜单
    @RequestMapping("/all")
    public  Object getAllMenu(){
        Object result = menuService.getAllMenu();
        return result;
    }


    //  修改角色路由的菜单
    @RequestMapping("/change")
    @OperatorLog
    public  Object changeMenu(@RequestBody ChangeMenuRoleParam changeMenuRoleParam){
        return menuService.changeRoleMenu(changeMenuRoleParam);
    }

}
